using System;
using System.ComponentModel;
using System.Linq.Expressions;

namespace CloudClipboardSync.MvvmFw
{
    public class MvvmBase: INotifyPropertyChanged
    {
        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        protected void NotifyPropertyChanged(string propertyName)
        {
            PropertyChanged.Raise(propertyName, this);
        }

        protected void NotifyPropertyChanged(params Expression<Func<object>>[] expressions)
        {
            foreach (var expr in expressions)
                NotifyPropertyChanged(ExpressionUtils.PropertyToString(expr));
        }
    }
}